package com.edu.lmtimetrackerpro;

import android.app.Activity;
import android.os.Bundle;
import android.view.View; // Needed to access view /CG
import android.widget.Button; // Needed by the button /CG


public class LMTimeTrackerProActivity extends Activity
{
    public static final String PREFS_NAME = "LMTimeTrackerProSettings"; // Name of settings file /CG
    private boolean timerStarted = false;

	/**
	 * This method is used to do start/stop the time
	 */
    public void punchAction(View view)
    {
        Button button = (Button) findViewById(R.id.button); // Get the button element /CG

        if (timerStarted) { // Check if the timer is on /CG
            timerStarted = false;
            button.setText("START");
        } else { // If the timer is off /CG & JO
            timerStarted = true;
            button.setText("STOP");
        }
    }

    /** Called when the activity is first created. */
    @Override
	public void onCreate(Bundle savedInstanceState)
	{
		// Restore preferences
//		SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); // Load application settings file /CG

		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}
}
